{
  "metadata": {
    "language_info": {
      "codemirror_mode": {
        "name": "python",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8"
    },
    "kernelspec": {
      "name": "python",
      "display_name": "Python (Pyodide)",
      "language": "python"
    }
  },
  "nbformat_minor": 4,
  "nbformat": 4,
  "cells": [
    {
      "cell_type": "code",
      "source": "import micropip\nawait micropip.install(\"aiocoap[prettyprint]\")\nimport aiocoap\nctx = await aiocoap.Context.create_client_context()",
      "metadata": {
        "trusted": true
      },
      "execution_count": 1,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": "req = aiocoap.Message(code=aiocoap.GET, uri=\"coaps+ws://rd.coap.amsuess.com/.well-known/core\")\nawait ctx.request(req).response",
      "metadata": {
        "trusted": true
      },
      "execution_count": 2,
      "outputs": [
        {
          "execution_count": 2,
          "output_type": "execute_result",
          "data": {
            "text/plain": "<aiocoap.Message at 0x190e358: no mtype, 2.05 Content (no MID, token 0311) remote <WSRemote at 0x1e61de0, hostinfo rd.coap.amsuess.com, local localhost>, 1 option(s), 260 byte(s) payload>",
            "text/html": "<details style=\"padding-left:1em\"><summary style=\"margin-left:-1em;display:list-item;\">Message with code <abbr title=\"Successful Response Code 2.05\">CONTENT</abbr>, remote &lt;WSRemote at 0x1e61de0, hostinfo rd.coap.amsuess.com, local localhost&gt;</summary>\n                <details><summary style=\"display:list-item\">1 option</summary><ol><li value=\"12\"><abbr title=\"option 12: elective, safe-to-forward, part of the cache key\">CONTENT_FORMAT</abbr>: <abbr title=\"Content format 40, named ContentFormat.LINKFORMAT\">application/link-format</abbr></ol></details><div><p style=\"color:gray;font-size:small;\">application/link-format content was re-formatted</p><pre><div class=\"highlight\"><pre><span></span><span class=\"p\">&lt;</span><span class=\"nl\">/.well-known/core</span><span class=\"p\">&gt;; </span><span class=\"na\">ct</span><span class=\"o\">=</span><span class=\"ss\">40</span><span class=\"p\">,</span>\n<span class=\"p\">&lt;</span><span class=\"nl\">/.well-known/rd</span><span class=\"p\">&gt;,</span>\n<span class=\"p\">&lt;</span><span class=\"nl\">/rd</span><span class=\"p\">&gt;; </span><span class=\"na\">ct</span><span class=\"o\">=</span><span class=\"ss\">40</span><span class=\"p\">; </span><span class=\"na\">rt</span><span class=\"o\">=</span><span class=\"ss\">core.rd</span><span class=\"p\">,</span>\n<span class=\"p\">&lt;</span><span class=\"nl\">/endpoint-lookup/</span><span class=\"p\">&gt;; </span><span class=\"na\">ct</span><span class=\"o\">=</span><span class=\"ss\">40</span><span class=\"p\">; </span><span class=\"na\">rt</span><span class=\"o\">=</span><span class=\"ss\">core.rd-lookup-ep</span><span class=\"p\">; </span><span class=\"na\">obs</span><span class=\"p\">,</span>\n<span class=\"p\">&lt;</span><span class=\"nl\">/resource-lookup/</span><span class=\"p\">&gt;; </span><span class=\"na\">ct</span><span class=\"o\">=</span><span class=\"ss\">40</span><span class=\"p\">; </span><span class=\"na\">rt</span><span class=\"o\">=</span><span class=\"ss\">core.rd-lookup-res</span><span class=\"p\">; </span><span class=\"na\">obs</span><span class=\"p\">,</span>\n<span class=\"p\">&lt;</span><span class=\"nl\">https://christian.amsuess.com/tools/aiocoap/#version-0.4.7</span><span class=\"p\">&gt;; </span><span class=\"na\">rel</span><span class=\"o\">=</span><span class=\"ss\">impl-info</span>\n</pre></div>\n</pre></div>"
          },
          "metadata": {}
        }
      ]
    }
  ]
}